home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2001 May / may_2001.iso / intercd / root / Multimedia / ^DivX_Article / virtualdub / VirtualDub-source-1_4d / Setup / help.cpp next >
Encoding:
C/C++ Source or Header  |  2000-02-01  |  865 b   |  37 lines

  1. #include <windows.h>
  2.  
  3. ///////////////////////////////////////////////////////////////////////////
  4. //
  5. //    help support
  6. //
  7. ///////////////////////////////////////////////////////////////////////////
  8.  
  9. static char g_szHelpPath[MAX_PATH]="VirtualD.hlp";
  10.  
  11. void HelpSetPath() {
  12.     char szPath[MAX_PATH];
  13.     char *lpFilePart;
  14.  
  15.     if (GetModuleFileName(NULL, szPath, sizeof szPath))
  16.         if (GetFullPathName(szPath, sizeof g_szHelpPath, g_szHelpPath, &lpFilePart))
  17.             strcpy(lpFilePart, "VirtualD.hlp");
  18. }
  19.  
  20. void HelpShowHelp(HWND hwnd) {
  21.     WinHelp(hwnd, g_szHelpPath, HELP_FINDER, 0);
  22. }
  23.  
  24. void HelpPopup(HWND hwnd, DWORD helpID) {
  25.     WinHelp(hwnd, g_szHelpPath, HELP_CONTEXTPOPUP, helpID);
  26. }
  27.  
  28. void HelpPopupByID(HWND hwnd, DWORD ctrlID, DWORD *lookup) {
  29.     while(lookup[0]) {
  30.         if (lookup[0] == ctrlID)
  31.             HelpPopup(hwnd, lookup[1]);
  32.  
  33.         lookup+=2;
  34.     }
  35. }
  36.  
  37.